package Thread;

public class PriorityDemo {
    public static void main(String[] args) {
        Thread max = new Thread(){
            public void run(){
                for (int i = 0; i < 10; i++) {
                    System.out.println("MAX");
                }
                Thread m = Thread.currentThread();//获取当前线程
                System.out.println(m.getPriority());
            }
        };
        Thread min = new Thread(){
            public void run(){
                for (int i = 0; i < 10; i++) {
                    System.out.println("MIN");
                }
            }
        };
        Thread nor = new Thread(){
            public void run(){
                for (int i = 0; i < 10; i++) {
                    System.out.println("NOR");
                }
            }
        };
        min.setPriority(Thread.MIN_PRIORITY);//1
        max.setPriority(Thread.MAX_PRIORITY);//10
        max.start();
        nor.start();
        min.start();
    }
}
